﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:students" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="students">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="student">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="firstName" type="xs:string" />
              <xs:element name="lastName" type="xs:string" />
              <xs:element name="sex" type="xs:string" />
              <xs:element name="birthDate" type="xs:date" />
              <xs:element name="phone" type="xs:unsignedInt" />
              <xs:element name="email" type="xs:string" />
              <xs:element name="course" type="xs:string" />
              <xs:element name="speciality" type="xs:string" />
              <xs:element name="facultyNumber" type="xs:unsignedInt" />
              <xs:element maxOccurs="unbounded" name="exam">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="name" type="xs:string" />
                    <xs:element name="tutor" type="xs:string" />
                    <xs:element name="score" type="xs:unsignedByte" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element maxOccurs="unbounded" name="enrolment">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="enrolmentDate" type="xs:date" />
                    <xs:element name="examScore" type="xs:decimal" />
                    <xs:element maxOccurs="unbounded" name="TeacherRecomendations">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="TeacherFirstName" type="xs:string" />
                          <xs:element name="TeacherLastName" type="xs:string" />
                          <xs:element name="TeacherRecomendation" type="xs:string" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>